/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CGame.h
//
//		Author			:		Vindicated Games
//
//		Purpose			:		Be the main vein for the game
//
//		Dates			:		Written( Feb 12, 2011 ) by Vindicated Games		LastUpdate( Feb 12, 2011  ) by Vindicated Games 
//	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef CGAME_H_
#define CGAME_H_

#include <windows.h>
#include "../Game States/IBaseState.h"
#include "../SGD Wrappers/CSGD_Direct3D.h"
#include "../SGD Wrappers/CSGD_TextureManager.h"
#include "../SGD Wrappers/CSGD_DirectSound.h"
#include "../SGD Wrappers/CSGD_FModManager.h"
#include "../SGD Wrappers/CSGD_DirectInput.h"
#include "../Managers/VIN_SoundManager.h"
#include "../Managers/VIN_ObjectManager.h"
#include "CPlayerProfile.h"


class InputManager;

class CGame
{

private:

	//Data Members
	CSGD_Direct3D*								m_pD3D;
	CSGD_TextureManager*						m_pTM;
	CSGD_DirectSound*							m_pDS;
	CSGD_FModManager*							m_pFM;
	VIN_SoundManager*							m_pSM;
	CSGD_DirectInput*							m_pDI;
	VIN_ObjectManager*							m_pOM;
	IBaseState*									m_pGS;

	CPlayerProfile								ActiveProfile;
	int LoadID;

	//Time Based and FPS counting Variables
	float m_fElapsedTime;
	DWORD m_dwPreviousTimeStamp;
	int m_nFrameCount;
	DWORD m_dwFPSTimeStamp;
	int m_nFPS;

	CGame();
	~CGame();
	CGame( const CGame& copy);
	CGame& operator=( const CGame& assign);

	void Render();
	void Update( float fElapsedTime);
	bool Input();

public:

	int SaveSlot;

	////////////////////////////////////////////
	//	Singleton Accessor
	////////////////////////////////////////////
	static CGame* GetInstance();

	////////////////////////////////////////////
	//	Initalize : Sets all the SGD singletons
	////////////////////////////////////////////
	void GameInit(HWND hWnd, HINSTANCE hInstance, int nScreenWidth, int nScreenHeight, bool bIsWindowed);	

	////////////////////////////////////////////////////////////////
	//	Main : Game is in the nitty gritty process everything needed
	///////////////////////////////////////////////////////////////
	bool Main();

	/////////////////////////////////////////////////////////
	//	ShutDown : Game Over lets shut things down
	/////////////////////////////////////////////////////////
	void ShutDown();

	/////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////
	//						Accessors							  //
	/////////////////////////////////////////////////////////
	/////////////////////////////////////////////////////////
	CPlayerProfile* GetActiveSave();
	float GetElapsedTime() { return m_fElapsedTime; }
	////////////////////////////////////////////////////////
	//	Mutators : Change information held for safekeeping
	////////////////////////////////////////////////////////

	////////////////////////////////////////////////////////
	//	ChangeState :	Change the current state
	////////////////////////////////////////////////////////
	void ChangeState( IBaseState* pNewState );

	void FillProfile( int Health, int Combat, int Durability, int Speed, int Rage, int Cash);
	

};

#endif